package com.party.core.model.commune;

import com.google.common.collect.Maps;

import java.util.List;
import java.util.Map;

/**
 * 首页查询条件枚举
 * Created by hqh.
 *
 * @date 2019/11/25 0023
 * @time 11:35
 */
public enum IndexCQueryType {

    CINTEGRALTYPE_CATEGORY_ORDINARY(0, new String[]{"社群总人数","有效会员"," 活跃数","自组织活跃数",
            "推荐会员数","行业数","总规模(单位:万)"}),
    CINTEGRALTYPE_CATEGORY_RECOMMEND(1, new String[]{"户外","公益","奉献","学习","拜访"}),
    CINTEGRALTYPE_CATEGORY_GIFT(2, new String[]{"参加过戈壁","运动时长(单位:分钟)","有宗教信仰","平均年龄"});

    //状态码
    private Integer code;

    //状态值
    private String[] values;

    IndexCQueryType(Integer code, String[] values) {
        this.code = code;
        this.values = values;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String[] getValues() {
        return values;
    }

    public void setValues(String[] values) {
        this.values = values;
    }

    public static String[] getValues(Integer code){
        for (IndexCQueryType integralType : IndexCQueryType.values()){
            if (integralType.getCode().equals(code)){
                return integralType.getValues();
            }
        }
        return null;
    }

    public static Map<Integer, String[]> convertMap(){
        Map<Integer, String[]> map = Maps.newHashMap();
        for (IndexCQueryType integralType : IndexCQueryType.values()){
            map.put(integralType.getCode(), integralType.getValues());
        }
        return map;
    }

}
